<?php
/**
 * Created by PhpStorm.
 * User: dell
 * Date: 2018/12/10
 * Time: 15:07
 */
namespace app\admin\controller;

use app\admin\model\RulesModel;
use app\admin\model\GroupModel;
class Rules extends BaseController
{
    //权限显示页面
    public function index(){
        $RulesModel=new RulesModel();
        $res=$RulesModel->AllData();
        return view('index',['res'=>$res[0],'page'=>$res[1]]);
    }
    //权限的开启和禁用
    public function del(){
        $RulesModel=new RulesModel();
        $res=$RulesModel->IsStatus(input('id'),input('status'));
        if ($res['code']==1)
            echo "<script>alert('".$res['msg']."')</script>";
        else
            echo "<script>alert('".$res['msg']."')</script>";
        $this->redirect('rules/index');
    }
}